﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Phone.Info;

/**
 * 创建时间：2015/1/14 10:23:29
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace ComicIsland.Common
{
    public class DeviceInfoHelper
    {
        public static string GetDeviceFirmwareVersion
        {
            get
            {
                return DeviceStatus.DeviceFirmwareVersion;
            }
        }
        public static string GetDeviceHardwareVersion
        {
            get
            {
                return DeviceStatus.DeviceHardwareVersion;
            }
        }
        public static long GetDeviceTotalMemory
        {
            get
            {
                return DeviceStatus.DeviceTotalMemory;
            }
        }

        public static long GetApplicationCurrentMemoryUsage
        {
            get { return DeviceStatus.ApplicationCurrentMemoryUsage; }
        }

        public static string GetDeviceManufacturer
        {
            get
            {
                return DeviceStatus.DeviceManufacturer;
            }
        }
        public static string GetDeviceName
        {
            get
            {
                return DeviceStatus.DeviceName;
            }
        }

        public static string GetDeviceOSPlatform
        {
            get { return Environment.OSVersion.Platform.ToString(); }
        }

        public static string GetDeviceOS
        {
            get { return Environment.OSVersion.ToString(); }
        }

        public static string GetDeviceOSVersion
        {
            get
            {
                return Environment.Version.ToString();
            }
        }

        public static string GetDeviceUniqueIDToHex
        {
            get
            {
                object value = null;
                if (!DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out value))
                {
                    return string.Empty;
                }
                byte[] duIds = value as byte[];
                if (duIds != null && duIds.Length > 0)
                {
                    return Helper.ByteToHexStr(duIds);
                }
                return string.Empty;
            }
        }
    }
}
